//该文件专门用于创建整个应用的路由器
import VueRouter from 'vue-router'

import Home from '../pages/Home'
import News from '../pages/News'
import Message from '../pages/Message'
import About from '../pages/About'


//创建路由器实例
const router = new VueRouter({
  routes: [
    {
      path: '/about',
      name: 'about',
      component: About
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      children: [
        {
          path: 'news',
          name: 'news',
          component: News
        },
        {
          path:'message',
          name:'message',
          component: Message
        }
      ]
    },
    
  ]
});
//导出路由器实例
export default router